Analysis date: 2023-10-16

Depends on

CRC_Xenografts_Batch2_DataProcessing Script

load("../Data/Cache/Xenografts_Batch2_DataProcessing.RData")

TODO

Setup

Load libraries and functions

Analysis

DEP

Tyrosine all

Each condition vs ctrl

data_diff_ctrl_vs_E_pY <- test_diff(pY_se_Set2, type="manual", test = "E_vs_ctrl")
## Tested contrasts: E_vs_ctrl
dep_ctrl_vs_E_pY <- add_rejections_SH(data_diff_ctrl_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_ctrl_vs_E_pY, contrast = "E_vs_ctrl", 
                 add_names = TRUE,
                additional_title = "pY") 
Return_DEP_Hits_Plots(data = pY_Set2_form, dep_ctrl_vs_E_pY, comparison = "E_vs_ctrl_diff")
## 'select()' returned 1:many mapping between keys and columns
## Loading required namespace: reactome.db
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

data_diff_EC_vs_ctrl_pY <- test_diff(pY_se_Set2, type="manual", test = "EC_vs_ctrl")
## Tested contrasts: EC_vs_ctrl
dep_EC_vs_ctrl_pY <- add_rejections_SH(data_diff_EC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_EC_vs_ctrl_pY, contrast = "EC_vs_ctrl", 
                 add_names = TRUE,
                additional_title = "pY") 
Return_DEP_Hits_Plots(data = pY_Set2_form, dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff")
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns
## Warning in min(screen_pval05_neg[, logFcColStr]): no non-missing arguments to
## min; returning Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(cs1s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs1s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs2s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs2s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs3s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs3s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

## Note: Row-scaling applied for this heatmap

Plot_Enrichment_Single_Pathway(dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff", 
                               pw = "Epigenetic regulation of gene expression")
data_diff_EBC_vs_ctrl_pY <- test_diff(pY_se_Set2, type="manual", test = "EBC_vs_ctrl")
## Tested contrasts: EBC_vs_ctrl
dep_EBC_vs_ctrl_pY <- add_rejections_SH(data_diff_EBC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_EBC_vs_ctrl_pY, contrast = "EBC_vs_ctrl", 
                 add_names = TRUE,
                additional_title = "pY")
Return_DEP_Hits_Plots(data = pY_Set2_form, dep_EBC_vs_ctrl_pY, comparison = "EBC_vs_ctrl_diff")
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

## Note: Row-scaling applied for this heatmap

EC vs E

data_diff_EC_vs_E_pY <- test_diff(pY_se_Set2, type = "manual", 
                              test = c("EC_vs_E"))
## Tested contrasts: EC_vs_E
dep_EC_vs_E_pY <- add_rejections_SH(data_diff_EC_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_EC_vs_E_pY, contrast = "EC_vs_E",  add_names = TRUE, additional_title = "pY", proteins_of_interest = "EGFR")
Return_DEP_Hits_Plots(data = pY_Set2_form, dep_EC_vs_E_pY, comparison = "EC_vs_E_diff")
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

## Note: Row-scaling applied for this heatmap

#data_results <- get_df_long(dep)

EBC vs EC

data_diff_EBC_vs_EC_pY <- test_diff(pY_se_Set2, type = "manual", 
                              test = c("EBC_vs_EC"))
## Tested contrasts: EBC_vs_EC
dep_EBC_vs_EC_pY <- add_rejections_SH(data_diff_EBC_vs_EC_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_EBC_vs_EC_pY, contrast = "EBC_vs_EC",  add_names = TRUE, additional_title = "pY")
Return_DEP_Hits_Plots(data = pY_Set2_form, dep_EBC_vs_EC_pY, comparison = "EBC_vs_EC_diff")
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

#data_results <- get_df_long(dep)

Serine/Threonine all

Each condition vs ctrl

data_diff_ctrl_vs_E_pST <- test_diff(pST_se_Set2, type="manual", test = "E_vs_ctrl")
## Tested contrasts: E_vs_ctrl
dep_ctrl_vs_E_pST <- add_rejections_SH(data_diff_ctrl_vs_E_pST, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_ctrl_vs_E_pST, contrast = "E_vs_ctrl", 
                 add_names = TRUE,
                additional_title = "pST") 
Return_DEP_Hits_Plots(data = pST_Set2_form, dep_ctrl_vs_E_pST, comparison = "E_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

data_diff_EC_vs_ctrl_pST <- test_diff(pST_se_Set2, type="manual", test = "EC_vs_ctrl")
## Tested contrasts: EC_vs_ctrl
dep_EC_vs_ctrl_pST <- add_rejections_SH(data_diff_EC_vs_ctrl_pST, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_EC_vs_ctrl_pST, contrast = "EC_vs_ctrl", 
                 add_names = TRUE,
                additional_title = "pST") 
Return_DEP_Hits_Plots(data = pST_Set2_form, dep_EC_vs_ctrl_pST, comparison = "EC_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

Plot_Enrichment_Single_Pathway(dep_EC_vs_ctrl_pST, comparison = "EC_vs_ctrl_diff", 
                               pw = "Epigenetic regulation of gene expression")
data_diff_EBC_vs_ctrl_pST <- test_diff(pST_se_Set2, type="manual", test = "EBC_vs_ctrl")
## Tested contrasts: EBC_vs_ctrl
dep_EBC_vs_ctrl_pST <- add_rejections_SH(data_diff_EBC_vs_ctrl_pST, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_EBC_vs_ctrl_pST, contrast = "EBC_vs_ctrl", 
                 add_names = TRUE,
                additional_title = "pST")
Return_DEP_Hits_Plots(data = pST_Set2_form, dep_EBC_vs_ctrl_pST, comparison = "EBC_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

EC vs E

data_diff_EC_vs_E_pST <- test_diff(pST_se_Set2, type = "manual", 
                              test = c("EC_vs_E"))
## Tested contrasts: EC_vs_E
dep_EC_vs_E_pST <- add_rejections_SH(data_diff_EC_vs_E_pST, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_EC_vs_E_pST, contrast = "EC_vs_E",  add_names = TRUE, additional_title = "pST", proteins_of_interest = "EGFR")
Return_DEP_Hits_Plots(data = pST_Set2_form, dep_EC_vs_E_pST, comparison = "EC_vs_E_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

## Note: Row-scaling applied for this heatmap

#data_results <- get_df_long(dep)

EBC vs EC

data_diff_EBC_vs_EC_pST <- test_diff(pST_se_Set2, type = "manual", 
                              test = c("EBC_vs_EC"))
## Tested contrasts: EBC_vs_EC
dep_EBC_vs_EC_pST <- add_rejections_SH(data_diff_EBC_vs_EC_pST, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Volcano(dep_EBC_vs_EC_pST, contrast = "EBC_vs_EC",  add_names = TRUE, additional_title = "pST")
Return_DEP_Hits_Plots(data = pST_Set2_form, dep_EBC_vs_EC_pST, comparison = "EBC_vs_EC_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

#data_results <- get_df_long(dep)

For Phosphosite Plus kinase enrichment

EC_vs_ctrl_pST_7AA <- left_join( (rowData(dep_EC_vs_ctrl_pST) %>% as_tibble() %>% 
  #filter(LTB4_vs_ctrl_p.adj< 0.05, LTB4_vs_ctrl_diff > 1.2) %>% 
    select(annotation = ID, Annotated_Sequence, HGNC_Symbol, fc = EC_vs_ctrl_diff,  p = EC_vs_ctrl_p.adj) %>% unique ),
  (all_pST_sites %>% select(Annotated_Sequence, Sequence_7_AA, HGNC_Symbol)),
  by=c("Annotated_Sequence", "HGNC_Symbol") ) %>% filter(!is.na(Sequence_7_AA)) %>% 
  mutate( peptide = str_to_upper(Sequence_7_AA) ) %>%
  select(annotation, peptide, fc, p) %>% as.data.frame()

Save

EC_vs_ctrl_pST_7AA %>% select(peptide, fc, p)  %>% write.table(file = "../Data/Kinase_enrichment/Batch2_Set2_EC_vs_ctrl_pST_7AA.txt", quote = FALSE, row.names = F, col.names = F, sep = "\t")

rowData(dep_EC_vs_ctrl_pY) %>% as_tibble() %>% 
  filter(EC_vs_ctrl_diff>1) %>%
  select(HGNC_Symbol ) %>% unique() %>%
  write.table("../Data/Kinase_enrichment/Batch2_Set2_EC_vs_ctrl_pY_FCmorethan1_forstring.txt", quote = F, row.names = F, col.names = F, sep = "\t")

Session Info

sessionInfo()
## R version 4.2.3 (2023-03-15)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur ... 10.16
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] lubridate_1.9.2             forcats_1.0.0              
##  [3] stringr_1.5.0               dplyr_1.1.2                
##  [5] purrr_1.0.2                 readr_2.1.4                
##  [7] tidyr_1.3.0                 tibble_3.2.1               
##  [9] ggplot2_3.4.2               tidyverse_2.0.0            
## [11] mdatools_0.14.0             SummarizedExperiment_1.28.0
## [13] GenomicRanges_1.50.2        GenomeInfoDb_1.34.9        
## [15] MatrixGenerics_1.10.0       matrixStats_1.0.0          
## [17] DEP_1.20.0                  org.Hs.eg.db_3.16.0        
## [19] AnnotationDbi_1.60.2        IRanges_2.32.0             
## [21] S4Vectors_0.36.2            Biobase_2.58.0             
## [23] BiocGenerics_0.44.0         fgsea_1.24.0               
## 
## loaded via a namespace (and not attached):
##   [1] circlize_0.4.15        fastmatch_1.1-4        plyr_1.8.8            
##   [4] igraph_1.5.1           gmm_1.8                lazyeval_0.2.2        
##   [7] shinydashboard_0.7.2   crosstalk_1.2.0        BiocParallel_1.32.6   
##  [10] digest_0.6.33          foreach_1.5.2          htmltools_0.5.6       
##  [13] fansi_1.0.4            magrittr_2.0.3         memoise_2.0.1         
##  [16] cluster_2.1.4          doParallel_1.0.17      tzdb_0.4.0            
##  [19] limma_3.54.2           ComplexHeatmap_2.14.0  Biostrings_2.66.0     
##  [22] imputeLCMD_2.1         sandwich_3.0-2         timechange_0.2.0      
##  [25] colorspace_2.1-0       blob_1.2.4             xfun_0.40             
##  [28] crayon_1.5.2           RCurl_1.98-1.12        jsonlite_1.8.7        
##  [31] impute_1.72.3          zoo_1.8-12             iterators_1.0.14      
##  [34] glue_1.6.2             hash_2.2.6.2           gtable_0.3.3          
##  [37] zlibbioc_1.44.0        XVector_0.38.0         GetoptLong_1.0.5      
##  [40] DelayedArray_0.24.0    shape_1.4.6            scales_1.2.1          
##  [43] pheatmap_1.0.12        vsn_3.66.0             mvtnorm_1.2-2         
##  [46] DBI_1.1.3              Rcpp_1.0.11            plotrix_3.8-2         
##  [49] mzR_2.32.0             viridisLite_0.4.2      xtable_1.8-4          
##  [52] clue_0.3-64            reactome.db_1.82.0     bit_4.0.5             
##  [55] preprocessCore_1.60.2  sqldf_0.4-11           MsCoreUtils_1.10.0    
##  [58] DT_0.28                htmlwidgets_1.6.2      httr_1.4.6            
##  [61] gplots_3.1.3           RColorBrewer_1.1-3     ellipsis_0.3.2        
##  [64] farver_2.1.1           pkgconfig_2.0.3        XML_3.99-0.14         
##  [67] sass_0.4.7             utf8_1.2.3             STRINGdb_2.10.1       
##  [70] labeling_0.4.2         tidyselect_1.2.0       rlang_1.1.1           
##  [73] later_1.3.1            munsell_0.5.0          tools_4.2.3           
##  [76] cachem_1.0.8           cli_3.6.1              gsubfn_0.7            
##  [79] generics_0.1.3         RSQLite_2.3.1          fdrtool_1.2.17        
##  [82] evaluate_0.21          fastmap_1.1.1          mzID_1.36.0           
##  [85] yaml_2.3.7             knitr_1.43             bit64_4.0.5           
##  [88] caTools_1.18.2         KEGGREST_1.38.0        ncdf4_1.21            
##  [91] mime_0.12              compiler_4.2.3         rstudioapi_0.15.0     
##  [94] plotly_4.10.2          png_0.1-8              affyio_1.68.0         
##  [97] stringi_1.7.12         bslib_0.5.0            highr_0.10            
## [100] MSnbase_2.24.2         lattice_0.21-8         ProtGenerics_1.30.0   
## [103] Matrix_1.6-0           tmvtnorm_1.5           vctrs_0.6.3           
## [106] pillar_1.9.0           norm_1.0-11.1          lifecycle_1.0.3       
## [109] BiocManager_1.30.22    jquerylib_0.1.4        MALDIquant_1.22.1     
## [112] GlobalOptions_0.1.2    data.table_1.14.8      cowplot_1.1.1         
## [115] bitops_1.0-7           httpuv_1.6.11          R6_2.5.1              
## [118] pcaMethods_1.90.0      affy_1.76.0            promises_1.2.1        
## [121] KernSmooth_2.23-22     codetools_0.2-19       MASS_7.3-60           
## [124] gtools_3.9.4           assertthat_0.2.1       chron_2.3-61          
## [127] proto_1.0.0            rjson_0.2.21           withr_2.5.0           
## [130] GenomeInfoDbData_1.2.9 parallel_4.2.3         hms_1.1.3             
## [133] grid_4.2.3             rmarkdown_2.23         shiny_1.7.4.1
knitr::knit_exit()